package cn.iune.erp.setting;

import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

import com.justep.baas.data.RowState;

@Entity
@Table(name = "BillMaxCode"
, uniqueConstraints = { 
	@UniqueConstraint(columnNames = { "billType", "enterpriseNo" ,"orderDate"}) 
}
)
@NamedQuery(name="BillMaxCode.findAll", query="SELECT s FROM BillMaxCode s")
public class BillMaxCode {
	
	@Id
	@Column(length=32)
	private String fID;
	
	private Date orderDate;
	
	@Column(length=4)
	private String billType;

	@Column(length=4)
	private String yearNo;

	@Column(length=2)
	private String monthNo;

	@Column(length=2)
	private String dayNo;

	private int maxCode;
	
//	@Column(length=15)
//	private String cUsercode;
//	@Column(length=20)
//	private String cUsername;//关单人
	private Timestamp cDatetime;
	
//	@Column(length=65)
//	private String userId;

	@Column(length=128)
	private String enterpriseNo;
	

	@Version
	private int version = 0;
	
	@Transient//非持久字段
	private RowState rowState;
	public RowState getRowState() {
		return rowState;
	}
	public void setRowState(RowState rowState) {
		this.rowState = rowState;
	}
	
	
	public int getVersion() {
		return version;
	}
	public void setVersion(int version) {
		this.version = version;
	}
	public String getfID() {
		return fID;
	}
	public void setfID(String fID) {
		this.fID = fID;
	}
	public String getBillType() {
		return billType;
	}
	public void setBillType(String billType) {
		this.billType = billType;
	}
	public String getYearNo() {
		return yearNo;
	}
	public void setYearNo(String yearNo) {
		this.yearNo = yearNo;
	}
	public String getMonthNo() {
		return monthNo;
	}
	public void setMonthNo(String monthNo) {
		this.monthNo = monthNo;
	}
	public String getDayNo() {
		return dayNo;
	}
	public void setDayNo(String dayNo) {
		this.dayNo = dayNo;
	}
	public Timestamp getcDatetime() {
		return cDatetime;
	}
	public void setcDatetime(Timestamp cDatetime) {
		this.cDatetime = cDatetime;
	}
	public String getEnterpriseNo() {
		return enterpriseNo;
	}
	public void setEnterpriseNo(String enterpriseNo) {
		this.enterpriseNo = enterpriseNo;
	}
	public Date getOrderDate() {
		return orderDate;
	}
	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}
	public int getMaxCode() {
		return maxCode;
	}
	public void setMaxCode(int maxCode) {
		this.maxCode = maxCode;
	}

	

}
